#ifndef TIMEFRAME_H
#define TIMEFRAME_H

class TimeFrame
{
public:
   TimeFrame(char unit, int length) {unit_ = unit; length_ = length;}

   char unit() const {return unit_;}
   int length() const {return length_;}

   bool isDaily() const {return unit_ == 'd';}
   bool isWeekly() const {return unit_ == 'w';}
   bool isMonthly() const {return unit_ == 'm';}
   bool isQuarterly() const {return unit_ == 'q';}
   bool isAnnual() const {return unit_ == 'a';}

   static const TimeFrame weekly;
   static const TimeFrame daily;
   static const TimeFrame monthly;
   static const TimeFrame quarterly;
   static const TimeFrame annual;

private:
   char unit_;
   int length_;
};

#endif // TIMEFRAME_H